jQuery(function(){
  var $notif = jQuery('.widget.notif');
  $notif.find('button').button({"icons" : {"primary" : "ui-icon-closethick"}, text: false});
  var to = null;
  $notif.slideDown(1000,'easeInOutBack',function(){
    to = setTimeout(function(){
      $notif.trigger('hide');
    },5000);
  }).bind('hide',function(){
    clearTimeout(to); to=null;
    $notif.slideUp(400,'easeInOutElastic');
  }).one('click',function(){
    $notif.delay(500).trigger('hide');
  });
  var margin = ($notif.width()/2)*-1;
  $notif.css({
     'margin-left': margin
  })
  
});